function ShowPop(){
	ShowPopDiv('<div><form action = "/mark" method = "POST"><p><label for = "title">Title: </label><input name = "title" size = "50" id = "title"/></p><p><label for = "url">URL:</label><input name = "url" size = "50" id = "url" /></p><p><label for = "tags">Tags: </label><input name = "tags" size = "50" id = "tags"></p><p align="center"><input type = "submit" value = "Mark It" /> or <a class = "cancel" href = "/">Cancel</a></p></form></div>');
}

//获得当前页面高度
function GetPageHeight() {
    if ($.browser.msie){
        return document.compatMode == "CSS1Compat" ? document.documentElement.clientHeight :document.body.clientHeight;
    }else{
        return self.innerHeight;
    }
}
//获得当前页面宽度
function GetPageWidth() {
    if ($.browser.msie) {
        return document.compatMode == "CSS1Compat" ? document.documentElement.clientWidth :document.body.clientWidth;
    }else{
        return self.innerWidth;
    }
}
//显示遮盖层
function ShowCoverDiv()
{
    $("#coverdiv").remove();
    $("body").append("<div id='coverdiv'></div>");
    $("#coverdiv").css({"left": "0px", "top": "0px", "position": "absolute", "width": GetPageWidth(), "height": GetPageHeight(), "background-color": "#888", "opacity": 0.8, "filter": "alpha(opacity=80)" });
}

function ShowPopDiv(innerHtml)
{
    ShowCoverDiv();
    $("#TextDiv").remove();
    $("body").append("<div id='TextDiv'></div>");
    if (innerHtml != null){
    	$(innerHtml).css({ "display": "block"});
        $(innerHtml).appendTo("#TextDiv");
    }
    var margintop = (GetPageHeight() - document.getElementById("TextDiv").offsetHeight) / 2;
    var marginleft = (GetPageWidth() - document.getElementById("TextDiv").offsetWidth) / 2;
    $("#TextDiv").css({ "display": "none", "position": "absolute", "z-index": "9", "top": margintop, "left": marginleft });
    $("#TextDiv").show("fast");
    window.onresize = function()
    {
        if (document.getElementById("coverdiv") != null && document.getElementById("TextDiv") != null)
            $("#coverdiv").css({ "width": GetPageWidth(), "height": GetPageHeight() });
        if ($("TextDiv") != null)
        {
            var margintop = (GetPageHeight() - document.getElementById("TextDiv").offsetHeight) / 2;
            var marginleft = (GetPageWidth() - document.getElementById("TextDiv").offsetWidth) / 2;
            $("#TextDiv").css({ "top": margintop, "left": marginleft });
        }
    }
}

function closeDiv()
{
	$("#coverdiv").remove();
	$("#TextDiv").remove();
}
